package org.bbs.demo.topic.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface LikesDao {

    @Update("update bbstopic set t_likes = t_likes + 1 where topic_id = #{topic_id}")
    public int updateLike(String topic_id);

    @Insert("insert into user_text_likes (user_id , topic_id) values (#{user_id} , #{topic_id})")
    public int logLike(String user_id, String topic_id);

    //点赞，sexy+3
    @Update("update bbstopic set sexy = sexy + 3 where topic_id = #{topic_id}")
    public int likesSexy(String topic_id);
}
